#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <math.h>
int test(int x)
{
	int count = 0;
	int j = 0;
	int sum = 0;
	int i = x;
	while (x / 10)
	{
		x = x / 10;
		count++;
	}
	for (j = count; j >=0; j--)
	{
		sum = sum + (int)pow(10, j) * (i % 10);
		if (i / 10)
		{
			i = i / 10;
		}
		else
		{
			i = i % 10;
		}
	}
	return sum;
}
int main()
{
	int x = 0;
	scanf("%d", &x);
	int ret = test(x);
	printf("%d\n", ret);
	return 0;
}